What is coffeeify?
The coffeeify npm package is a Browserify transform for CoffeeScript. It allows you to require CoffeeScript files in your Browserify bundle, enabling seamless integration of CoffeeScript into your JavaScript projects.
What are coffeeify's main functionalities?
Transform CoffeeScript to JavaScript
This feature allows you to transform CoffeeScript files into JavaScript using Browserify. The code sample demonstrates how to bundle a CoffeeScript file (`main.coffee`) into a JavaScript file (`bundle.js`) using the coffeeify transform.
const browserify = require('browserify');
const fs = require('fs');
browserify({
entries: ['main.coffee'],
transform: ['coffeeify']
})
.bundle()
.pipe(fs.createWriteStream('bundle.js'));
Integration with Browserify
This feature shows how to integrate coffeeify with Browserify directly. The code sample demonstrates how to bundle a CoffeeScript file (`app.coffee`) into a JavaScript file (`app.bundle.js`) by specifying the `.coffee` extension and using the coffeeify transform.
const browserify = require('browserify');
const coffeeify = require('coffeeify');
const fs = require('fs');
browserify({
entries: ['app.coffee'],
extensions: ['.coffee']
})
.transform(coffeeify)
.bundle()
.pipe(fs.createWriteStream('app.bundle.js'));
Other packages similar to coffeeify
coffeescript
The `coffeescript` package is the official CoffeeScript compiler. It can be used to compile CoffeeScript files into JavaScript. Unlike coffeeify, which is a Browserify transform, `coffeescript` is a standalone compiler that can be used in various build processes.
gulp-coffee
The `gulp-coffee` package is a Gulp plugin for compiling CoffeeScript files. It integrates with the Gulp build system, allowing you to include CoffeeScript compilation in your Gulp tasks. This is different from coffeeify, which is specifically designed for use with Browserify.
grunt-contrib-coffee
The `grunt-contrib-coffee` package is a Grunt plugin for compiling CoffeeScript files. It integrates with the Grunt build system, enabling you to add CoffeeScript compilation to your Grunt tasks. This package is similar to gulp-coffee but is designed for use with Grunt instead of Gulp.
coffeeify
browserify v2 plugin for coffee-script
mix and match .coffee
and .js
files in the same project
![Build Status](https://travis-ci.org/jnordberg/coffeeify.png?branch=master)
example
given some files written in a mix of js
and coffee
:
foo.coffee:
console.log(require './bar.js')
bar.js:
module.exports = require('./baz.coffee')(5)
baz.coffee:
module.exports = (n) -> n * 111
install coffeeify into your app:
$ npm install coffeeify
when you compile your app, just pass -t coffeeify
to browserify:
$ browserify -t coffeeify foo.coffee > bundle.js
$ node bundle.js
555
you can omit the .coffee
extension from your requires if you add the extension to browserify's module extensions:
module.exports = require('./baz')(5)
$ browserify -t coffeeify --extension=".coffee" foo.coffee > bundle.js
$ node bundle.js
555
install
With npm do:
npm install coffeeify
license
MIT